<script setup lang="ts">
import { Icon } from '@iconify/vue';
defineOptions({
  name: 'LangSwitch'
});

interface Props {
  lang: App.I18n.LangType;
  langOptions: App.I18n.LangOption[];
}

interface Emits {
  (e: 'changeLang', lang: App.I18n.LangType): void;
}

defineProps<Props>();
const emit = defineEmits<Emits>();
const changeLang = (lang: App.I18n.LangType) => {
  emit('changeLang', lang);
};
</script>

<template>
 <NDropdown :value="lang" :options="langOptions" trigger="hover" @select="changeLang">
   <Icon icon="cil:language" />
 </NDropdown>
</template>

<style scoped>

</style>
